/**
 * @param {number[]} nums
 * @return {boolean}
 */
var find132pattern = function(nums) {
    const stack = []
    for(let i = 0; i < nums.length; i++) {
        let flag = false
        while(stack.length !== 0 && stack[stack.length - 1] >= nums[i]) {
            flag = true
            stack.pop()
        }
        if(stack.length !== 0 && flag) {
            return true
        }
        stack.push(nums[i])
    }
    return false
};
console.log(find132pattern([3, 5, 0, 3, 4]));